// This MFC Samples source code demonstrates using MFC Microsoft Office Fluent User Interface 
// (the "Fluent UI") and is provided only as referential material to supplement the 
// Microsoft Foundation Classes Reference and related electronic documentation 
// included with the MFC C++ library software.  
// License terms to copy, use or distribute the Fluent UI are available separately.  
// To learn more about our Fluent UI licensing program, please visit 
// http://msdn.microsoft.com/officeui.
//
// Copyright (C) Microsoft Corporation
// All rights reserved.

// WindowsGui.h : main header file for the WindowsGui application
//
#pragma once

#ifndef __AFXWIN_H__
	#error "include 'stdafx.h' before including this file for PCH"
#endif

#include "resource.h"       // main symbols


// CWindowsGuiApp:
// See WindowsGui.cpp for the implementation of this class
//
enum ApplicationLook
{
	APP_LOOK_BLUE,
	APP_LOOK_BLACK,
	APP_LOOK_SILVER,
	APP_LOOK_AQUA
};

enum ScreenTip
{
	SHOW_FEATURE,
	SHOW_TEXT,
	SHOW_NONE
};

class CWindowsGuiApp : public CWinAppEx
{
public:
	CWindowsGuiApp();

private:
	static BOOL CALLBACK EnumWndProc(HWND hwnd,LPARAM lParam);
// Overrides
public:
	virtual BOOL InitInstance();
	virtual BOOL ExitInstance();

	BOOL InitLocalClient();
	BOOL FirstRunSetup();

	System::Guid GetTopGuid(System::Guid guid);

	gcroot<KingOfCSharp::iHunter::LocalClient ^> m_clrClient;
	gcroot<KingOfCSharp::iHunter::UI::TaskRunner ^> m_clrTaskRunner;

	gcroot<KingOfCSharp::iHunter::UI::NotifyAgent ^> m_clrNotify;
	virtual void PreLoadState();
	virtual void LoadCustomState();
	virtual void SaveCustomState();
	void ShowOptions(int page = 0);

	void SaveGlobalSettings();
	void LoadGlobalSettings();
	afx_msg void OnAppAbout();
	afx_msg void OnToolsOptions();
	afx_msg void OnToolsCustomize();
	afx_msg void OnAppExit();
	OSVERSIONINFO osVersionInfo;
	bool m_bAutoUpdate;
	int m_iUpdateInterval;
	bool m_bCheckExists;
	int m_iColorScheme;
	int m_iTimeSpan;
	int m_iScreenTip;
	CString m_lpszPersonalName;
	bool m_bUseSystemLang;
	bool m_bDownloadAttachments;

public:
	CMultiDocTemplate* pDocTemplate;
	DECLARE_MESSAGE_MAP()
public:
	BEGIN_DELEGATE_MAP(CWindowsGuiApp)
		EVENT_DELEGATE_ENTRY(OnErrorOccur, System::Object^, KingOfCSharp::iHunter::PluginErrorEventArgs ^)
	END_DELEGATE_MAP()
	void OnErrorOccur(System::Object ^sender, KingOfCSharp::iHunter::PluginErrorEventArgs ^e);


};

extern CWindowsGuiApp theApp;
